<?php include_once './application/views/sys_admin/common/header.php';  ?>
<!-- admin_main -->
<div class=" definewidth m20">
	<form action="/sys_admin/systemadmin/edit/" method="post" id="form" name="form">
	<input name="id" type=hidden value="<?php echo $id;?>" />
	<font color="red"><?php echo @validation_errors(); ?></font>
		<table class="table table-bordered table-hover m10">
		 <tr>
	        <td class="tableleft">用户名</td>
	        <td><?php echo $adminname;?> </td>
	        <td class="tableleft">管理类型 </td>
	        <td> 
	        	<select name="admin_type" id="admin_type" Onchange="setQQ();">
					<?php 
					foreach ($type as $k=>$v){ 
						if($v['name']=='客服'){
					?>
					<option data="<?php echo $v['id'];?>" id="kftypeHeart" value="_selfHeart_" <?php if($type_id==$v['id']){ echo "selected";} ?>><?php echo $v['name'];?></option>
					
					<?php 
					    }else{
					?>
					<option value="<?php echo $v['id'];?>" <?php if($type_id==$v['id']){ echo "selected";} ?>><?php echo $v['name'];?></option>
					<?php
					   }
					}
					?>
				  </select>
				 <input name="kftype" type="hidden" value="" id="kftype">
				<input name="qq" id="iheart" <?php if(empty($kefu_qq)) echo "style='display:none;'"; ?> value="<?php echo $kefu_qq; ?>" size="14" maxlength="10" onfocus="clearit(this);"/> 
			</td>
	   	</tr>
	    <tr>
	        
	        <td class="tableleft">管理员备注 </td>
	        <td> <input type="text" name="remark" id="remark" size="60"  value="<?php echo set_value('remark');?>" /> </td>
	        <td class="tableleft">状态 </td>
	        <td> <input type="radio" name="fstatus" value="1" <?php if($status==1) echo 'checked'?> />开通
					<input type="radio" name="fstatus" value="0" <?php if($status==0) echo 'checked'?>/>关闭</td>
	   	</tr>
	   	 <tr>
	        <td class="tableleft"> </td>
	        <td> <button type="button" class="btn btn-success"  onclick="this.form.submit();" >提交</button> </td>
	        <td class="tableleft"> </td>
	        <td>  </td>
	   	</tr>
	   </table>
	</form>

</div>

<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({formID:"form",debug:false,submitOnce:true,
		onError:function(msg,obj,errorlist){
			$("#errorlist").empty();
			$.map(errorlist,function(msg){
				$("#errorlist").append("<li>" + msg + "</li>")
			});
			alert(msg);
		},
		submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...'
	});
    $("#name").formValidator({autoModify:true,onShow:"",onFocus:"用户名在2-10个字符之间",onCorrect:""}).inputValidator({min:2,max:10,onError:"用户名不能为空,请确认"});
   // $("#password").formValidator({autoModify:true,onShow:"",onFocus:"密码在3-15个字符之间",onCorrect:""}).inputValidator({min:3,max:15,empty:{leftempty:false,rightempty:false,emptyerror:"密码两边不能有空符号"},onError:"密码不能为空,请确认"});
});
function setQQ(){
	if(document.getElementById("admin_type").value == "_selfHeart_"){
		document.getElementById("iheart").style.display = "";
		document.getElementById("iheart").style.color = "#c0c0c0";
		document.getElementById("iheart").value = "请输入客服QQ";
		document.getElementById("kftype").value = $("#kftypeHeart").attr('data');
	}else{
		document.getElementById("iheart").style.display = "none";
		document.getElementById("iheart").value = document.getElementById("admin_type").value;
		document.getElementById("kftype").value = "";
	}
}
function clearit(obj){
	if(obj.value=="请输入客服QQ")
	{
		obj.value="";
		obj.style.color="#000000";
	}
}
</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>